package org.xyl.context;

import java.util.*;

/**
 * 知识上下文 - 存储从静态知识库中检索到的相关知识
 */
public class KnowledgeContext {
    private List<KnowledgeItem> knowledgeItems;
    
    public KnowledgeContext() {
        this.knowledgeItems = new ArrayList<>();
    }
    
    public void addKnowledgeItem(KnowledgeItem item) {
        this.knowledgeItems.add(item);
    }
    
    public List<KnowledgeItem> getKnowledgeItems() {
        return knowledgeItems;
    }
    
    /**
     * 知识条目类
     */
    public static class KnowledgeItem {
        private String title;
        private String source;
        private String content;
        private double relevanceScore;
        
        public KnowledgeItem(String title, String source, String content, double relevanceScore) {
            this.title = title;
            this.source = source;
            this.content = content;
            this.relevanceScore = relevanceScore;
        }
        
        public String getTitle() {
            return title;
        }
        
        public String getSource() {
            return source;
        }
        
        public String getContent() {
            return content;
        }
        
        public double getRelevanceScore() {
            return relevanceScore;
        }
    }
}